package com.lvmama.comm.sync.pojo;

import java.io.Serializable;
import java.util.Date;

import com.lvmama.comm.sync.utils.RandomFactory;

/**
 * 同步数据.
 * @author zuoxiaoshuai
 * 
 *  2016-10-31 pengfei
 */

public class SyncTrigger implements Serializable {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 7952400751467348123L;
	
	/** 主键. */
	private String triggerId;
	
	/** 数据库scheme. */
	private String userName;
	
	/** 表名. */
	private String tableName;
	
	/** 主键值. */
	private String pkValue;

	/** 主键值 in. */
	private String batchPkValue;
	
	/** 状态 true or false. */
	private String status;
	
	/** 创建时间. */
	private Date createTime;
	
	/**
	 *  触发类型.
	 */
	private String triggerType;
	
	/** 数据源ID. */
	private String dataSourceId;
	
	/** 备用字段1. */
	private String fieldOne;
	
	/** 备用字段2. */
	private String fieldTwo;
	
	/** 备用字段3. */
	private String fieldThree;
	
	/** 执行优先级，默认为0，级别越高，优先级越高*/
	private Long pLevel = 0L;

	private int sqlRandom = RandomFactory.nextInt(800);
	
	private String serverName;
	
	/**关联com_log*/
	private Long objectId;
	
	
	/**
	 *主键起始值 
	 */
	private String  pkBegin;
	
	/**
	 * 增量
	 */
	private Long pkQuantity; 
	
	/**
	 * 完成数量
	 */
	private Long completeCount;
	
	/**
	 * 成功数量
	 */
	private Long successNum;
	
	/**
	 * 失败数量
	 */
	private Long failNum;
	
	/**
	 * 备用
	 */
	private String remark;
	
	/**
	 * Gets the trigger id.
	 *
	 * @return the trigger id
	 */
	public String getTriggerId() {
		return triggerId;
	}

	/**
	 * Sets the trigger id.
	 *
	 * @param triggerId the new trigger id
	 */
	public void setTriggerId(String triggerId) {
		this.triggerId = triggerId;
	}

	/**
	 * Gets the user name.
	 *
	 * @return the user name
	 */
	public String getUserName() {
		return userName;
	}

	/**
	 * Sets the user name.
	 *
	 * @param userName the new user name
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}

	/**
	 * Gets the table name.
	 *
	 * @return the table name
	 */
	public String getTableName() {
		return tableName;
	}

	/**
	 * Sets the table name.
	 *
	 * @param tableName the new table name
	 */
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	/**
	 * Gets the pk value.
	 *
	 * @return the pk value
	 */
	public String getPkValue() {
		return pkValue;
	}

	/**
	 * Sets the pk value.
	 *
	 * @param pkValue the new pk value
	 */
	public void setPkValue(String pkValue) {
		this.pkValue = pkValue;
	}

	/**
	 * Gets the status.
	 *
	 * @return the status
	 */
	public String getStatus() {
		return status;
	}

	/**
	 * Sets the status.
	 *
	 * @param status the new status
	 */
	public void setStatus(String status) {
		this.status = status;
	}

	/**
	 * Gets the creates the time.
	 *
	 * @return the creates the time
	 */
	public Date getCreateTime() {
		return createTime;
	}

	/**
	 * Sets the creates the time.
	 *
	 * @param createTime the new creates the time
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/**
	 * Gets the trigger type.
	 *
	 * @return the trigger type
	 */
	public String getTriggerType() {
		return triggerType;
	}

	/**
	 * Sets the trigger type.
	 *
	 * @param triggerType the new trigger type
	 */
	public void setTriggerType(String triggerType) {
		this.triggerType = triggerType;
	}

	/**
	 * Gets the data source id.
	 *
	 * @return the data source id
	 */
	public String getDataSourceId() {
		return dataSourceId;
	}

	/**
	 * Sets the data source id.
	 *
	 * @param dataSourceId the new data source id
	 */
	public void setDataSourceId(String dataSourceId) {
		this.dataSourceId = dataSourceId;
	}

	/**
	 * Gets the field one.
	 *
	 * @return the field one
	 */
	public String getFieldOne() {
		return fieldOne;
	}

	/**
	 * Sets the field one.
	 *
	 * @param fieldOne the new field one
	 */
	public void setFieldOne(String fieldOne) {
		this.fieldOne = fieldOne;
	}

	/**
	 * Gets the field two.
	 *
	 * @return the field two
	 */
	public String getFieldTwo() {
		return fieldTwo;
	}

	/**
	 * Sets the field two.
	 *
	 * @param fieldTwo the new field two
	 */
	public void setFieldTwo(String fieldTwo) {
		this.fieldTwo = fieldTwo;
	}

	/**
	 * Gets the field three.
	 *
	 * @return the field three
	 */
	public String getFieldThree() {
		return fieldThree;
	}

	/**
	 * Sets the field three.
	 *
	 * @param fieldThree the new field three
	 */
	public void setFieldThree(String fieldThree) {
		this.fieldThree = fieldThree;
	}

	public int getSqlRandom() {
		return sqlRandom;
	}

	public void setSqlRandom(int sqlRandom) {
		this.sqlRandom = sqlRandom;
	}

	@Override
	public String toString() {
		return "SyncTrigger [triggerId=" + triggerId + ", userName=" + userName
				+ ", tableName=" + tableName + ", pkValue=" + pkValue
				+ ", status=" + status + ", createTime=" + createTime
				+ ", triggerType=" + triggerType + ", dataSourceId="
				+ dataSourceId + ", fieldOne=" + fieldOne + ", fieldTwo="
				+ fieldTwo + ", fieldThree=" + fieldThree + ",pkQuantity="+pkQuantity+",pkBegin="+pkBegin+"]";
	}

	public Long getpLevel() {
		return pLevel;
	}

	public void setpLevel(Long pLevel) {
		this.pLevel = pLevel;
	}

	public String getServerName() {
		return serverName;
	}

	public void setServerName(String serverName) {
		this.serverName = serverName;
	}

	public Long getObjectId() {
		return objectId;
	}

	public void setObjectId(Long objectId) {
		this.objectId = objectId;
	}

	public String getPkBegin() {
		return pkBegin;
	}

	public void setPkBegin(String pkBegin) {
		this.pkBegin = pkBegin;
	}

	public Long getPkQuantity() {
		return pkQuantity;
	}

	public void setPkQuantity(Long pkQuantity) {
		this.pkQuantity = pkQuantity;
	}

	public Long getCompleteCount() {
		return completeCount;
	}

	public void setCompleteCount(Long completeCount) {
		this.completeCount = completeCount;
	}

	public Long getSuccessNum() {
		return successNum;
	}

	public void setSuccessNum(Long successNum) {
		if(null==successNum){
			this.successNum=0l;
		}else{
			this.successNum = successNum;
		}
	}

	public Long getFailNum() {
		return failNum;
	}

	public void setFailNum(Long failNum) {
		if(null==failNum){
			this.failNum = 0l;
		}else{
			this.failNum = failNum;
		}
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getBatchPkValue() {
		return batchPkValue;
	}

	public void setBatchPkValue(String batchPkValue) {
		this.batchPkValue = batchPkValue;
	}
}
